<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title></title>
    <script type="text/javascript" src="../../jClass.js"></script>
    <script type="text/javascript" src="../jquery.js"></script>
    <script type="text/javascript">

        (function($) {
            $(document).ready(function() {
                
                include("/libraries/jclass/net.js");
                net = new jclass.net.URLLoader();

                net.AddEventListener(jclass.net.ProgressEvent.PROGRESS, onProgress);
                net.AddEventListener(jclass.events.Event.COMPLETE, onComplete);
                net.AddEventListener(jclass.events.Event.ERROR, onError);

                var req = new jclass.net.URLRequest("../assets/files.zip", false);
                //req.requestHeaders.push(new jclass.net.RequestHeader('Pragma','no-cache'));
                net.load(req);
                
                $pb = $("#pb");
                function onProgress(evt) {
                    $pb.css('width', Math.floor((evt.bytesLoaded * 100) /  (evt.bytesTotal || 1)))
                }

                function onComplete(evt) {
                    console.log("complete");
                }

                function onError(evt) {
                    console.log("error ", evt.data);
                }

            });
        })(jQuery)
    </script>
    <link rel="stylesheet" type="text/css" href="../style.css" />
</head>
<body>
<div style="width:100px;height:20px; border:1px solid black;">
    <div id="pb" style="width:0px; height:20px; background: #000077;"></div>
</div>

</body>
</html>
